/*
 * 1455. 学号
 * 实现一个名为Class的类，包含如下的一些属性和方法：
 * 一个public的students属性，是一个Student类的数组。
 * 一个构造函数，接受一个参数n，代表班级里有n个学生。构造函数需要创建n个学生的实例对象并放在students这个成员中，每个学生按照创建的顺序，学号需要依次标记为0, 1, 2 ... n-1。
 * https://www.lintcode.com/problem/student-id/description
 * 
 * 样例
 * Java: 
 * Class cls = new Class(3)
 * cls.students[0]; // should be a student instance with id = 0
 * cls.students[1]; // should be a student instance with id = 1
 * cls.students[2]; // should be a student instance with id = 2
 * 
 * Python:
 * cls = new Class(3)
 * cls.students[0] # should be a student instance with id = 0
 * cls.students[1] # should be a student instance with id = 1
 * cls.students[2] # should be a student instance with id = 2
 * 
 * 2018.06.10 @jeyming
 */
package student_id_1455;

class Student {
    public int id;
    
    public Student(int id) {
        this.id = id;
    }
}

class Class {
    /**
     * Declare a public attribute `students` which is an array of `Student`
     * instances
     */
    // write your code here.
	public Student[] students;
     
    /**
     * Declare a constructor with a parameter n which is the total number of
     * students in the *class*. The constructor should create n Student
     * instances and initialized with student id from 0 ~ n-1
     */
    // write your code here
	Class(int n){
		students = new Student[n];
		for(int i = 0; i < n; ++i) {
			students[i] = new Student(i);
		}
	}
}

public class Student_id_1455 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	}

}
